package com.yzh.shixiday1.Controller;


import com.yzh.shixiday1.domain.Vo.UserVo;
import com.yzh.shixiday1.domain.pojo.User;
import com.yzh.shixiday1.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
  private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping("/select/{id}")
    public User SelectUser(@PathVariable("id") Integer id){
        return userService.SelectUser(id);
   //      return  userMapper.SelectUser(id);
    }


    @GetMapping("/selectVo/{id}")
    public UserVo SelectUserVo(@PathVariable("id") Integer id){
        return userService.SelectUserVo(id);
        //      return  userMapper.SelectUser(id);
    }




}
